package com.sz.biz.app.dto;

import java.util.Date;
import java.util.UUID;

/**
 * Function: TokenDto <br>
 * Author: Charles <br>
 * Date: 2017-01-04 15:56:00
 */
public class TokenDto {
    private String token;
    private String clientId;
    private long expire;
    private Date created;
    private boolean primary = true;

    public String getToken() {
        return token;
    }

    public void setToken(String token) {
        this.token = token;
    }

    public String getClientId() {
        return clientId;
    }

    public void setClientId(String client) {
        this.clientId = client;
    }

    public long getExpire() {
        return expire;
    }

    public void setExpire(long expire) {
        this.expire = expire;
    }

    public Date getCreated() {
        return created;
    }

    public void setCreated(Date created) {
        this.created = created;
    }

    public boolean getPrimary() {
        return primary;
    }

    public void setPrimary(boolean primary) {
        this.primary = primary;
    }

    /**
     *
     */
    public TokenDto() {
        this(UUID.randomUUID().toString().replaceAll("-", ""),
                UUID.randomUUID().toString().replaceAll("-", ""), 1800);
    }

    public TokenDto(String clientId, String token, long expire) {
        this.clientId = clientId;
        this.token = token;
        this.expire = expire;
        this.created = new Date();
    }
}
